package cn.IT.domain;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

/**
 * Approve entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "approve", catalog = "itsupport")
public class Approve implements java.io.Serializable {

	// Fields

	private Integer approveId;
	private User user;
	private Topic topic;
	private String answer;
	private String status;
	private Date createdOn;
	private Date updateTime;

	// Constructors

	/** default constructor */
	public Approve() {
	}

	/** minimal constructor */
	public Approve(Topic topic, String answer, String status, Date createdOn) {
		this.topic = topic;
		this.answer = answer;
		this.status = status;
		this.createdOn = createdOn;
	}

	/** full constructor */
	public Approve(User user, Topic topic, String answer, String status,
			Date createdOn, Date updateTime) {
		this.user = user;
		this.topic = topic;
		this.answer = answer;
		this.status = status;
		this.createdOn = createdOn;
		this.updateTime = updateTime;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "approveId", unique = true, nullable = false)
	public Integer getApproveId() {
		return this.approveId;
	}

	public void setApproveId(Integer approveId) {
		this.approveId = approveId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "approver", nullable = false)
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "topicId", nullable = false)
	public Topic getTopic() {
		return this.topic;
	}

	public void setTopic(Topic topic) {
		this.topic = topic;
	}

	@Column(name = "answer", nullable = false, length = 65535)
	public String getAnswer() {
		return this.answer;
	}

	public void setAnswer(String answer) {
		this.answer = answer;
	}

	@Column(name = "status", nullable = false)
	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	@Column(name = "createdOn", nullable = false, length = 19)
	public Date getCreatedOn() {
		return this.createdOn;
	}

	public void setCreatedOn(Date createdOn) {
		this.createdOn = createdOn;
	}

	@Column(name = "updateTime", length = 19)
	public Date getUpdateTime() {
		return this.updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

}